package ch01.a18;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/13 14:44
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/13 14:44
 */
public class Operation {
    public static double getResult(double numberA, double numberB, char oper) {
            double result;
            switch (oper) {
                case '+':
                    result = numberA + numberB;
                    break;
                case '-':
                    result = numberA - numberB;
                    break;
                case '*':
                    result = numberA * numberB;
                    break;
                case '/':
                    result = numberA / numberB;
                    break;
                default:
                    result = 0d;
            }
        return result;
    }
}
